package com.point.user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.point.user.dto.UserDto;
import com.point.user.entity.User;
import com.point.user.dao.UserMapper;
import com.point.user.service.UserService;
import com.point.user.vo.UserVo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.time.LocalDateTime;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangyh
 * @since 2019-09-24
 */
@Service(version = "1.0.0")
public class UserServiceImpl implements UserService {


    @Autowired
    private UserMapper userMapper;

    @Override
    public Integer addUser(UserDto userDto) {
        User user = new User();
        user.setUserName(userDto.getUserName());
        user.setPhoneNumber(userDto.getPhoneNumber());
        user.setAge(userDto.getAge());
        user.setCreateTime(LocalDateTime.now());
        return userMapper.insert(user);
    }

    @Override
    public Integer updateUser(UserDto userDto) {
        return null;
    }

    @Override
    public Page<UserVo> getUserPage(UserDto userDto) {
        return null;
    }

    @Override
    public UserVo getUserById(String id) {
        return null;
    }

    @Override
    public Boolean deleteUserById(String id) {
        return null;
    }
}
